<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:fn="http://java.sun.com/jsp/jstl/functions"
    xmlns:richext="http://java.sun.com/jsf/composite/richext">

<body>
    <ui:composition template="../templates/template.xhtml">
        <ui:define name="titre">Accueil::Recherche Eleve</ui:define>
    <ui:define name="zone1">
    	<div class="form">
    		<h:panelGroup layout="block">
	   	 		<h:form id="form">
				<h:messages id="messages" warnClass="msgWarn" errorClass="msgError" infoClass="msgInfo"
						globalOnly="true" />
		             <h:panelGrid columns="2" columnClasses="tabline1, tabline2" styleClass="spanelTable">
		        			<h:outputLabel id="matriculeLabel" for="matricule"  value="Matricule" styleClass="label"/>
		        			<h:inputText id="matricule" value ="#{RechercheEleveControleur.modele.critere.matricule}" />
		        			<h:outputLabel id="nomLabel" for="nom"  value="Nom" styleClass="label"/>
		        			<h:inputText id="nom" value="#{RechercheEleveControleur.modele.critere.nom}" />
		        			<h:outputLabel id="nomFamilleMereLabel" for="nomFamilleMere"  value="Nom de famille (Mère)" styleClass="label"/>
		        			<h:inputText id="nomFamilleMere" value="#{RechercheEleveControleur.modele.critere.nomMere}" />
		        			<h:outputLabel id="prenomLabel" for="prenom"  value="Prénom" styleClass="label"/>
		        			<h:inputText id="prenom" value="#{RechercheEleveControleur.modele.critere.prenom}" />
		        	</h:panelGrid>
		        	<div align="right" >
							<h:commandLink styleClass="btValider"   value="Lancer la recherche"  action="#{RechercheEleveControleur.lancerRechercherEleve}" />
					</div>
					<br/>
					<br/>
					<div class="borderBleu">
						<h:panelGroup rendered="#{fn:length(RechercheEleveControleur.modele.eleves) > 0}">
							<div class="titre">
								<h:outputLabel value="Résultat de la recherche" />
							</div>
						</h:panelGroup>
						<div id="formResult">
							 <rich:dataTable id="eleve" value="#{RechercheEleveControleur.modele.eleves}" 	var="eleve" 
		        				rendered="#{fn:length(RechercheEleveControleur.modele.eleves) > 0}" rows="10">
					        	<rich:column >
					        		<f:facet name="header">
					        			<h:outputText 	value="Matricule" />
					        		</f:facet>
					        		<h:outputText value="#{eleve.matricule}" />
					        	</rich:column>
					        	<rich:column >
					        		<f:facet name="header">
					        			<h:outputText 	value="Prénom" />
					        		</f:facet>
					        		<h:outputText value="#{eleve.prenom}" />
					        	</rich:column>
					        	<rich:column >
					        		<f:facet name="header">
					        			<h:outputText 	value="Nom" />
					        		</f:facet>
					        		<h:outputText value="#{eleve.nom}" />
					        	</rich:column>
					        	<rich:column >
					        		<f:facet name="header">
					        			<h:outputText 	value="Nom mère" />
					        		</f:facet>
					        		<h:outputText value="#{eleve.nommere}" />
					        	</rich:column>
					        	<rich:column >
					        		<f:facet name="header">
					        			<h:outputText 	value="Date de naissance" />
					        		</f:facet>
					        		<h:outputText value="#{eleve.datenaissance}" />
					        	</rich:column>
					        	<rich:column >
					        		<f:facet name="header">
					        			<h:outputText 	value="Lieu de naissance" />
					        		</f:facet>
					        		<h:outputText value="#{eleve.lieunaissance}" />
					        	</rich:column>
					        	<rich:column >
					        		<f:facet name="header">
					        			<h:outputText 	value="Adresse" />
					        		</f:facet>
					        		<h:outputText value="#{eleve.adresse}" /><h:outputText value=" " /><h:outputText value="#{eleve.quartier}" /><h:outputText value=" " /><h:outputText value="#{eleve.ville}" />
					        	</rich:column>
					        	<rich:column nowrap="nowrap" styleClass="f120px">
					        		
						        		<f:facet name="header">
						        			<h:outputText 	value="" />
						        		</f:facet>
						        		<h:commandLink styleClass="btnTableau" value="Réinscription" action="#{GestionInscriptionControleur.afficherEcranInscription}">
						        			<f:setPropertyActionListener target="#{GestionInscriptionControleur.modele.eleve}" value="#{eleve}"/>
						        			<f:setPropertyActionListener target="#{GestionInscriptionControleur.modele.reinscription}" value="true" />
						        		</h:commandLink>
						        		<richext:spacer width="3" />
						        		<h:commandLink styleClass="btnTableau" value="Saisir dossier"  action="#{GestionInscriptionControleur.afficherEcrCreationEleve}">
						        			<f:setPropertyActionListener target="#{GestionInscriptionControleur.modele.eleve}" value="#{eleve}"/>
						        			<f:setPropertyActionListener target="#{GestionInscriptionControleur.modele.modificationFlag}" value="true" />
						        		</h:commandLink>
						        		<richext:spacer width="3" />
						        		<h:commandLink styleClass="btnTableau" value="Consultation"  action="#{GestionInscriptionControleur.afficherEcrCreationEleve}">
						        			<f:setPropertyActionListener target="#{GestionInscriptionControleur.modele.eleve}" value="#{eleve}"/>
						        			<f:setPropertyActionListener target="#{GestionInscriptionControleur.modele.modificationFlag}" value="false" />
						        		</h:commandLink>
					        		
					        		
					        	</rich:column>
	       		 			</rich:dataTable>
						</div>
					</div>
	    		</h:form>
	    	</h:panelGroup>
	    </div>
    </ui:define>
</ui:composition>
</body>
</html>